Class KeyValuePairEqualityComparer<K,V>

Default equalityComparer for dictionary entries. Operations only look at keys and uses an externaly defined equalityComparer for that.

Implements

System.Collections.Generic.IEqualityComparer<KeyValuePair<K,V>>

Bases

object

Constructor overview

KeyValuePairEqualityComparer<K,V>() ,
KeyValuePairEqualityComparer<K,V>(System.Collections.Generic.IEqualityComparer<K> keyequalityComparer)

Method overview

Equals(KeyValuePair<K,V> entry1, KeyValuePair<K,V> entry2) ,
Equals(object obj), Inherited from object ,
Finalize(), Inherited from object ,
GetHashCode(KeyValuePair<K,V> entry) ,
GetHashCode(), Inherited from object ,
GetType(), Inherited from object ,
MemberwiseClone(), Inherited from object ,
ToString(), Inherited from object

Constructor details

KeyValuePairEqualityComparer<K,V>() Create an entry equalityComparer using the default equalityComparer for keys
KeyValuePairEqualityComparer<K,V>(System.Collections.Generic.IEqualityComparer<K> keyequalityComparer) Create an entry equalityComparer from a specified item equalityComparer for the keys
Parameters:
keyequalityComparer:The key equalityComparer

Method details

F bool Equals(KeyValuePair<K,V> entry1, KeyValuePair<K,V> entry2) Test two entries for equality
Returns:True if keys are equal
Parameters:
entry1:First entry
entry2:Second entry
F int GetHashCode(KeyValuePair<K,V> entry) Get the hash code of the entry
Returns:The hash code of the key
Parameters:
entry:The entry